home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BMUG Revelations
/
BMUG Revelations.toast
/
Programming
/
Programming Languages
/
PC Basic
/
PCBASIC Stand alone version
/
PCBASIC Demo
/
PCBASICDemoR
< prev
next >
Wrap
Text File
|
1992-02-22
|
21KB
|
782 lines
;
; Resource File For PCDemo
; McAssembly ( or direct compile) format
;
; The PCBASIC Manual, $50, describes the
; McAssembly Resource format
;
; order from:
;
; Pterodactyl Software
; c/o Harland Harrison
; 200 Davey Glen Rd #416
; Belmont CA 94002
; (415) 591-5270
;
; some equates we'll need:
;
chk equ $12 ;ascii for check mark character
visible equ $FFFF ;TRUE boolean
invisible equ 0 ;FALSE boolean
nogoaway equ 0 ;FALSE boolean
goaway equ $FFFF ;TRUE boolean
button equ 4 ;DITL BUTTON
chkbox equ 5 ;DITL CHECK BOX
radio equ 6 ;DITL RADIO BUTTON
stattext equ 8+128 ;DITL STATIC TEXT (DISABLED)
editxtds equ 16+128 ;EDIT TEXT DISABLED
iconitem equ 32 ICON in dialog box
;
; Signature of program
;
[[ DEMO,0
TEXT #"PCBASIC Demo Version 2.0 January 3, 1992"
]]
; Apple menu
$$ MENU,1,4 Menu ID 1
0,0,0 Placeholders
$FFFFFFFB enable mask - item 2 disabled
"/$14" menu title = apple char
2 two items in this menu
; item 1:
About PCBASIC Demo... the menu item
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 2:
-------------------- the menu item
0,0,0,0 no icon, no keybd, no mark, plain text
;
; Files menu
;
$$ MENU,302,4 Menu ID 302
0,0,0 Placeholders
$FFFFFFFF enable mask - none disabled
Order menu title
3 three items in this menu
; item 1:
"Send A Manual" the menu item
1,0 icon 257, no keybd equivalent
0,0 no marking char, text style = plain
; item 2:
"Send Shareware" the menu item
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 3:
"Quit"
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 4:
; Edit menu
$$ MENU,301,4 Menu ID 301
0,0,0 Placeholders
$FFFFFFFB enable mask - 2nd disabled
Edit menu title
6 six items in this menu
; item 1:
"Undo" the menu item
0,0,0,0 no icon, no keybd equivalent no marking char, text style = plain
; item 2:
"----------" the menu item
0,0,0,0 no icon, no keybd, no mark, plain text
; item 3:
"Cut"
0,'X',0,0 no icon, cmd X, no mark, plain text
; item 4:
"Copy" the menu item
0,'C',0,0 no icon, cmd C, no mark, plain text
; item 5:
"Paste" the menu item
0,'V',0,0 no icon, cmd V, no mark, plain text
; item 6:
"Clear" the menu item
0,0,0,0 no icon, no keybd, no mark, plain text
; Help menu
$$ MENU,303,4 Menu ID 303
0,0,0 Placeholders
$FFFFFFFF enable mask - none disabled
"Help" menu title
4 four items in this menu
; item 1:
"Using the Demo" the menu item
0,'H' no icon, keybd equivalent is H
0,0 no marking char, text style = plain
; item 2:
"Help with program" the menu item
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 3:
"How to order"
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 4:
"Help with help boxes"
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; Features function menu
$$ MENU,304,4 Menu ID 304
0,0,0 Placeholders
$FFFFFFFF enable mask - none disabled
"Features" menu title
7 seven items in this menu
; item 1:
"International" the menu item
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 2:
"IBM Compatible" the menu item
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 3:
"Menus and Function Keys"
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 4:
"Dialog and Alert Boxes"
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 5:
"Mouse and Editing"
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 6:
"Large Programs and Data"
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; item 7:
"Industrial Strength"
0,0 no icon, no keybd equivalent
0,0 no marking char, text style = plain
; Help Dialog List
$$ DITL,303,32 Dialog item list, ID = 303, ATTR=(32)
8 8 items in list
; item 1:
0 handle holder
10,25,30,455 display rectangle
StatText item type
"Subject for Help Menu item text" ;the item
; item 2:
0 handle holder
40,25,60,455 display rectangle
StatText item type
"^0" the item
; item 3:
0 handle holder
60,25,80,455 display rectangle
StatText item type
"^1" the item
; item 4:
0 handle holder
80,25,100,455 display rectangle
StatText item type
"^2" the item
; item 5:
0 handle holder
100,25,120,455 display rectangle
StatText item type
"^3" the item
; QUIT must be Item 6 or less
; item 6:
0 handle holder
140,360,157,410 display rectangle
button item type
"QUIT" the item
; NEXT must always be Item 7
; item 7:
0 handle holder
140,215,157,265 display rectangle
button item type
"NEXT" the item
; BACK must always be Item 8
; item 8:
0 handle holder
140,70,157,120 display rectangle
button item type
"BACK" the item
; Order Dialog List
$$ DITL,501,32 Dialog item list, ID = 501, ATTR=(32)
19 19 items in list
; item 1:
0 handle holder
20,175,40,455 display rectangle
StatText item type
"PCBASIC by Pterodactyl Software" ;the item
; item 2:
0 handle holder
60,125,80,455 display rectangle
editxtds item type
" "
; item 3:
0 handle holder
85,125,105,455 display rectangle
editxtds item type
" "
; item 4:
0 handle holder
110,125,130,455 display rectangle
editxtds item type
" "
; item 5:
0 handle holder
135,125,155,455 display rectangle
editxtds item type
" "
; item 6:
0 handle holder
160,125,180,275 display rectangle
editxtds item type
" "
; item 7:
0 handle holder
190,25,210,200 display rectangle
chkbox item type
"Stand Alone" the item
; item 8:
0 handle holder
210,25,230,200 display rectangle
chkbox item type
"MPW" the item
; item 9:
0 handle holder
190,200,210,450 display rectangle
radio item type
"Send me a Manual ($50) " the item
; item 10:
0 handle holder
210,200,230,450 display rectangle
radio item type
"Send me a trial disk (free)" the item
; item 11:
0 handle holder
230,360,247,410 display rectangle
button item type
"Print" the item
; item 12:
0 handle holder
230, 215, 247, 265 display rectangle
button item type
"Save" the item
; item 13:
0 handle holder
230,70,247,120 display rectangle
button item type
"Cancel" the item
; item 14:
0 handle holder
60,25,80,120 display rectangle
StatText item type
"Name" the item
; item 15:
0 handle holder
85,25,105,120 display rectangle
StatText item type
"Company" the item
; item 16:
0 handle holder
110,25,130,120 display rectangle
StatText item type
"Street" the item
; item 17:
0 handle holder
135,25,155,120 display rectangle
StatText item type
"City" the item
; item 18:
0 handle holder
160,25,180,120 display rectangle
StatText item type
"Telephone" the item
; item 19:
0 handle holder
12,25,44,57 display rectangle
iconitem item type
257 Resource ID of icon
; Debugger Dialog List
$$ DITL,650,32 Dialog item list, ID = 650, ATTR=(32)
9 9 items in list
; item 1:
0 handle holder
160,25,177,75 display rectangle
button item type
"Step" the item
; item 2:
0 handle holder
160,170,177,220 display rectangle
button item type
"G0" the item
; item 3:
0 handle holder
160,315,177,365 display rectangle
button item type
"Quit" the item
; item 4:
0 handle holder
20,125,40,455 display rectangle
StatText item type
"PCBASIC Debugger"
; item 5:
0 handle holder
120,25,140,190 display rectangle
StatText item type
"Stop at "
; item 6:
0 handle holder
120,200,140,340 display rectangle
editxtds item type
"0" ;the item
; item 7:
0 handle holder
95,25,115,380 display rectangle
StatText item type
"Line #" ;the item
; item 8:
0 handle holder
50,25,70,380 display rectangle
StatText item type
"a Variable" ; the item
; item 9:
0 handle holder
70,25,90,380 display rectangle
StatText item type
"a Variable" ; the item
;
; Add more StatText items here if you want to
; display more than two variables at a time
;
; Help Dialog Box
$$ DLOG,303,32 dialog, ID = 303, ATTR=32
90,15,260,495 bounds rectangle
1 type = modal dialog box
visible initial state
nogoaway no close box
0 refcon
303 resc ID of DLOG's item list
| no title
; Order Dialog Box
$$ DLOG,501,32 dialog, ID = 501, ATTR=32
45,15,300,495 bounds rectangle
1 type = modal dialog box
visible initial state
nogoaway no close box
0 refcon
501 resc ID of DLOG's item list
| no title
; Debugger Dialog Box
$$ DLOG,650,32 dialog, ID = 650, ATTR=32
100,60,280,450 bounds rectangle
1 type = modal dialog box
visible initial state
nogoaway no close box
0 refcon
650 resc ID of DLOG's item list
| no title
; BASIC default Window
$$ WIND,300,4 Window, id=300, attr=4
40,10,325,500
8 Zoom type window !!!
visible
nogoaway
0 refcon
PCBASIC Demo title
; Vertical scroll bar for WIND 300
$$ CNTL,300
20,400,220,416
0 initial value
Invisible
12000 max value
0 min value
16 scroll bar
0 refcon
"vertical scroll bar" ;title
; Horizontal scroll bar for WIND 300
$$ CNTL,400
200,20,216,400
0 initial value
Invisible
12000 max value
0 min value
16 scroll bar
0 refcon
"horizontal scroll bar" ;title
; Cursor
$$ CURS,300,4
$01801A70,$2648264A,$124D1249,$68099801,$88024002,$20022004,$10040808,$04080408
$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
$0008,$0008
; Pterodactyl Icon for menu item
$$ ICON,257
$01000000,$00800000,$00400000,$00600000,$00300000,$00380000,$001C0000,$001E0000
$001F0000,$000F8000,$000FD800,$000FD3FC,$000FE0FF,$000FE1C0,$000FF270,$001FF618
$001FFC00,$003FF000,$003FF000,$00FFE000,$01FFE000,$07BFC000,$FC3F8000,$F07F8000
$C07F4000,$00FE6000,$00F80000,$01F00000,$03C00000,$07800000,$3E000000,$F8000000
; Pterodactyl Icon & Mask for Program Icon
$$ ICN#,128
$01000000,$00800000,$00400000,$00600000,$00300000,$00380000,$001C0000,$001E0000
$001F0000,$000F8000,$000FD800,$000FD3FC,$000FE0FF,$000FE1C0,$000FF270,$001FF618
$001FFC00,$003FF000,$003FF000,$00FFE000,$01FFE000,$07BFC000,$FC3F8000,$F07F8000
$C07F4000,$00FE6000,$00F80000,$01F00000,$03C00000,$07800000,$3E000000,$F8000000
$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF
$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF
$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF
$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF
; Document Icon and mask for Document Icon
$$ ICN#,129
$01073A26,$0084A369,$0044BAA9,$0064A229,$00373A26,$00380000,$001C0000,$000E0000
$000F0000,$000F8000,$000FD800,$000FD3FC,$000FE0FF,$000FE1C0,$000FF270,$001FF618
$001FFC00,$003FF000,$003FF000,$00FFE000,$01FFE000,$07BFC000,$FC3F8000,$F07F8000
$C07F4000,$00FE6000,$00F80000,$01F00000,$03C00000,$07800000,$3E000000,$F8000000
$07C7FFFF,$07E7FFFF,$07F7FFFF,$03F7FFFF,$01FFFFFF,$00FFFFFF,$00FE0000,$007F0000
$007F8000,$007FFFFE,$007FFFFF,$003FFFFF,$003FFFFF,$003FFFFF,$003FFFFC,$003FFFFE
$007FFFFE,$007FFF00,$00FFFC00,$03FFFC00,$FFFFF800,$FFFFF000,$FFFFE000,$FFFFE000
$F9FFE000,$E1FFF000,$03FFF000,$07FC0000,$0FFC0000,$FFF80000,$FF800000,$FF000000
; Help dialog strings
$$ STR#,303,32
16
;
; panel 1 : Using DEMO...
"Select the items you would like to know about from"
"the FEATURES menu. Use the ORDER menu to add a"
"name to the mailing list file. Examine the"
"BASIC source of this program. It is very short."
; panel 2 : Help with program...
"Pterodactyl Software can help you get your application"
"running quickly ! Order our manual for $50. If your"
"staff is too busy, you can hire a Pterodactyl programmer"
"as a consultant at convenient fixed or hourly rates!"
; panel 3 : How to order...
"Order the PCBASIC manual from Pterodactyl Software"
" 200 Davey Glen Rd #416"
" Belmont CA 94002"
" phone: (415) 591-5270"
; panel 4 : Help with help boxes
"Its easy to create Help boxes like these with PCBASIC."
"First put the subject titles in Menu 303. Then put text"
"for each subject, up to about 1K in String list 303."
"If you don't need Help boxes, just delete Menu 303."
; Text of feature messages. This are used with :
; RESTORE # ID% : READ OneLine$
;
; International features
$$ STR#,501,32
18
" PCBASIC programs can be written for easy"
"translation into foreign languages. The menus, dialogs"
"and titles can all be defined in the resource file. Even"
"text messages, like these, can be put in the resource"
"file as string lists, such as this :"
""
" $$ STR#,501,32"
" 2"
" PCBASIC programs can be written for easy"
" translation into foreign languages."
""
"The strings are used in BASIC like DATA statements :"
""
" RESTORE #501"
" READ Msg$1,Msg$2,Msg$3,Msg$4"
" ? Msg$1 : ? Msg$2 : ? Msg$3 : ? Msg$4"
"
"END"
; IBM compatible
$$ STR#,502,32
14
" PCBASIC makes converting IBM™ PC programs"
"to Macintosh™ programs simple. PCBASIC is compatible"
"with BASICA, the BASIC used on the IBM™ PC. Special"
"Macintosh features like dialog boxes and windows, can be"
"added in the resource file. Most special IBM functions,"
"translate automatically into Macintosh features. The IBM"
"function keys become menu items. The multiple screen pages"
"available on some adapters, become multiple windows"
"on the Macintosh. The programs can even read back the text"
"written on the screen in PCBASIC, as in BASICA."
""
"IBM is a trademark of Internation Business Machines Inc."
"Macintosh is a trademark of Apple Computer Inc."
"END"
; Menu & function keys
$$ STR#,503,32
18
" In PCBASIC, the menus are created from resources."
"Other BASIC implementations use BASIC statements to create"
"every item of every menu. With PCBASIC, the menus are"
"defined with a resource compiler or editor. Of course the"
"program can change any menu item with BASIC statements. The"
"menu items can be enabled, disabled, inhibited, or marked"
"with a check mark or any other character."
""
" PCBASIC can compile many programs written for the"
"IBM™ PC or compatibles. Those programs may use the function"
"keys on those machines. BASICA statements such as these,"
""
" KEY (1) ON : ON KEY(1) GOSUB 100"
""
"are compiled without change. The function keys become menu"
"items. They can be grouped into any number of menus, which"
"can be arranged in any order on the menu bar."
"END"
; Dialogs & Alerts
$$ STR#,504,32
19
" Dialogs and alert boxes are easy to create with"
"PCBASIC. One BASIC statement will show the operator"
"a Modal Dialog or an Alert, wait for the operator to make"
"a selection or edit text, and return when the operator"
"pushes a button. It is as simple as this:"
""
" REM Display alert box 500 as a Stop Alert."
" REM The number of the button the operator"
" REM pressed will be in CHOICE%."
" 100 CHOICE%=ERROR(501,STOP)"
""
" REM Display dialog 500. Wait for a reply."
" REM The button number will be in CHOICE%."
" CHOICE%=DIALOG#500"
""
" REM Remove the box. The blank spot on the window"
" REM will be drawn again, automatically"
" CLOSE#500"
"END"
; Mouse, fonts and editing
$$ STR#,505,32
20
" PCBASIC handles the mouse activity for the system, menus,"
"dialog boxes and scroll bars. The BASIC programmer only has"
"to take care of clicks within the main windows. PCBASIC can"
"even vector to a line number as soon as the mouse is clicked"
"in the active window."
" "
" The special Edit menu simplifies editing. It takes care of"
"'Cut', 'Copy' and 'Paste' for your dialog boxes automatically."
"But you can handle the Edit menu selections for the active"
"window yourself. The Edit menu can vector to a BASIC line, or"
"you can poll for menu selections whenever you are ready."
" "
" PCBASIC has powerful mouse sensing commands, to make your"
"job still easier. Your BASIC program can detect a single click"
"or a multiple click with one MOUSE function call. Other calls"
"return the starting, ending and current locations of the mouse."
"The functions can return either graphic coordinates or the line"
"and column location for editing text! That makes highlighting"
"selected text simple, even when using a proportional font."
"END"
; Large programs and segmentation
$$ STR#,506,32
17
" PCBASIC compiles large programs and systems containing"
"many programs. You can divide large programs into segments"
"with one simple command. These segments will be read in from"
"the disk when they are needed. They will be discarded when"
"memory space is short. This happens automatically, without"
"any effort by the BASIC programmer."
""
" Many small programs can be compiled together as a package."
"These programs can all be in memory at the same time. When one"
"program calls another program in the package, the code will not"
"have to be read from the disk."
""
" Programs with large data spaces are handled easily too."
"Arrays are dynamic. They can be erased and created again, with a"
"different size, while the program is running. Large arrays are"
"relocatable blocks. The move around in memory to reuse space."
"END"
; Industrial strength
$$ STR#,507,32
12
" PCBASIC is an 'Industrial Strength' programming language."
"This means all the features of the Macintosh are accessible from"
"PCBASIC. The important features, such as dialogs, windows,"
"scroll bars, menus, and alert boxes are all part of the extended"
"BASIC language. All of the other features in the ROM and Operating"
"System, can be called from BASIC. Special BASIC statements can"
"access any of the ToolBox and QuickDraw routines. Even register"
"based calls, and calls that return function values can be used."
"Pascal or Assembler code can be linked to PCBASIC programs,"
"or short segments of 68000 Assembly language can actually be "
"imbedded within the BASIC code."
"END"
; Introduction
$$ STR#,508,32
17
" PCBASIC is a BASIC compiler from Pterodactyl Software."
" "
" There are two versions on the shareware disk:"
" "
" PCBASIC MPW is a 'tool' which runs under MPW."
" PCBASIC STA is a standalone compiler."
" "
" This program demonstrates a few of PCBASIC's features."
" "
" To get your copy of PCBASIC contact "
" "
" Harland Harrison "
" Pterodactyl Software "
" 200 Davey Glen Rd #416 "
" Belmont CA 94002 "
" (415) 591-5270 "
"END"
; Runtime Configuration
[[ CFIG,301
; .I
; SCREEN buffer & Update method
; 2 = Text buffer with attributes
; 6 = Text buffer without attributes
; 10 = Text buffer exists but don't use for automatic update
; 14 = Text buffer without attributes but don't update
DC.W 2
; String Space growth rate
DC.W 4096
; File Buffer Space
DC.W 4096
; Document Width
DC.W 640
; Document Height
DC.W 400
; Border Width
DC.W 40
; Border Height
DC.W 30
; Horiz Point Scale * 16
DC.W 16
; Vert Point Scale * 16
DC.W 16
; Aspect *16
DC.W 16
; Default font
DC.W 0
; Default font size
DC.W 12
; Character cell Height
DC.W 12
; Character cell Width
DC.W -1
]]
; File reference for program
$$ FREF,128 FREF resc, ID = 128
APPL filetype
0 local ID for icon list
| no filename follows the application
; File reference for document
$$ FREF,129 FREF resc, ID = 129
TEXT filetype
1 local ID for icon list
| no filename follows the application
; Bundle
$$ BNDL,128 bundle resc, ID = 128
DEMO the application's signature again
0 ID is again 0 by convention
2 two resc types in the BNDL list:
ICN#,2 map one icon list:
0,128 local ID 0 -> actual ID 128
1,129
FREF,2 map one FREF list:
0,128 local ID 0 -> actual ID 128
1,129